/**
 * 地图配置
 */

export default {
    data() {
        return {
            //百度地图
            baiduConfig:{
                ak:"",
                center:"广州市海珠区新港东路庭园路183号",//或填写坐标[113.37522439271066,23.101922220764084]
                zoom:15,
                version:"3.0",
                scrollWheelZoom:true
            },
            //高德地图
            amapConfig:{
                key:"",
                securityJsCode:"",
                center: [113.37522439271066,23.101922220764084],//只允许填写坐标 无法使用字符串
                zoom:15
            },
        }
    },
    methods: {
        /**
         * 设置中心点
         */
        setCenter(curValue){
            let center = curValue || this.center;
            if(center){
                let value = JSON.parse(center);
                this.baiduConfig.center=value.address;
                this.amapConfig.center=[value.longitude,value.latitude];
            }
        },
    }
}



